package Homework;

import java.util.Arrays;
import java.util.Random;

public class Homework05 {
    public static void main(String[] args) {


        int[] a=new int[6];

//        System.out.println(a[0]);
        System.out.println(a.length);
        for (int i=0;i<a.length;i++){
            System.out.println(a[i]);
        }
        //int[] a=new int[6];
        a=Arrays.copyOf(a,7);
        System.out.println(a.length);
        for (int i=0;i<a.length;i++){
            System.out.println(a[i]);
        }


        say();
        say(2);
        say(1,"你好啊");
        int sum = sum(1,2);
        System.out.println(sum);
        int[] arr;
        arr=generateArray(6,10);

        for(int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }



    }
    public static void say(){
        System.out.println("say");
    }

    public static void say(int i){
        System.out.println(i);
    }
    public static void say(int a,String b){
        System.out.println(a+b);
    }
    public static int sum(int a,int b){
        int sum = a+b;
        return sum;
    }

    public static int[] generateArray(int l,int max){
        Random rd = new Random();
        int[] arr =new  int[l];
        for (int i=0;i<l;i++){
            arr[i]= rd.nextInt(max);
        }
        return arr;
    }
}
